﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Collections;

namespace ORS.BLL
{
    public class Regester
    {
        private string _userid;
        private string _password;
        private string _cname;
        private string _gender;
        private DateTime _birthdate;
        private string _department;
        private DateTime _regdate;
        private string _phonenum;
        private string _mobilenum;
        private string _email;
        private string _identitycard;
        private int _roleid;
        private int _interestid;
        private int _validflag;

        public string Userid
        {
            get { return _userid; }
            set { _userid = value; }
        }

        public string Password
        {
            get { return _password; }
            set { _password = value; }
        }

        public string Cname
        {
            get { return _cname; }
            set { _cname = value; }
        }

        public string Gender
        {
            get { return _gender; }
            set { _gender = value; }
        }

        public DateTime Birthday
        {
            get { return _birthdate; }
            set { _birthdate = value; }
        }

        public string Department
        {
            get { return _department; }
            set { _department = value; }
        }

        public DateTime Regdate
        {
            get { return _regdate; }
            set { _regdate = value; }
        }

        public string Phonenum
        {
            get { return _phonenum; }
            set { _phonenum = value; }
        }

        public string Mobilenum
        {
            get { return _mobilenum; }
            set { _mobilenum = value; }
        }

        public string Email
        {
            get { return _email; }
            set { _email = value; }
        }

        public string Identitycard
        {
            get { return _identitycard; }
            set { _identitycard = value; }
        }

        public int Roleid
        {
            get { return _roleid; }
            set { _roleid = value; }
        }

        public int Interestid
        {
            get { return _interestid; }
            set { _interestid = value; }
        }

        public int Validflag
        {
            get { return _validflag; }
            set { _validflag = value; }
        }

        public bool userAdd(Hashtable userinfo)
        {
            ORS.DAL.DBHelper db = new ORS.DAL.DBHelper();
            if (db.Insert("tb_userlist", userinfo))
            {
                return true;
            }
            return false;
        }

        //公有静态方法，将SQL字符串里面的(')转换成('')
        public string GetSafeSqlString(String XStr)
        {
            return XStr.Replace("'", "''");

        }

        //公有静态方法，将SQL字符串里面的(')转换成('')，再在字符串的两边加上(')
        public string GetQuotedString(String XStr)
        {
            return ("'" + GetSafeSqlString(XStr) + "'");
        }



    }
}